#include <iostream>
#include <typeinfo>

using namespace std;

// IsA(variable, type):
// Return true iff variable is a descendant of (or is) the given type.
// For example:
//      if ( IsA(pTree, ExpJoin*) ) { ... }
#define IsA(variable, type)  ( dynamic_cast<type>(variable) ? true : false )


typedef struct a
{
	int a;
	int b;
}a;

int main ()
{
	struct a* mya = new a;
	struct a var;
	mya->a = 1;
	mya->b = 2;
	IsA(mya, a*);
	cout << typeid(mya).name() << endl;
	cout << typeid(var).name() << endl;
	delete mya;
	return 0;
}
